package com.hsteach.dao.mapper;

import com.hsteach.dao.domain.patrol.Behavior;
import com.hsteach.dao.domain.patrol.BehaviorCategory;
import com.hsteach.web.controller.patrol.dto.BehaviorCategoryDTO;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *
 * </p>
 *
 * @author mgb
 * @version BehaviorCategoryMapper, java v1.0 2023-11-14 22:15 EXP $
 */
public interface BehaviorCategoryMapper {
    BehaviorCategory getCategory(@Param("firstCategory") String firstCategory, @Param("secondCategory") String secondCategory
            ,@Param("orgCode") String orgCode );

    int insertCategory(@Param("firstCategory") String firstCategory,@Param("secondCategory") String secondCategory,@Param("sort")int sort,@Param("orgCode") String orgCode);
//    int insertCategory(@Param("firstCategory") String firstCategory,@Param("secondCategory") String secondCategory);

    BehaviorCategory getCategoryById(@Param("id")int id);

    int deleteCategory(@Param("id")int id);

    List<BehaviorCategory> queryCategory(@Param("firstCategory")String firstCategory
            ,@Param("secondCategory") String secondCategory
            ,@Param("orgCode") String orgCode);

    int updateCategory(BehaviorCategory behaviorCategory);

    int updateCategorySort(BehaviorCategoryDTO behaviorCategoryDTO);

    List<BehaviorCategory> queryCategoryByFirstCategory(@Param("firstCategory") String firstCategory,@Param("orgCode") String orgCode);

    List<BehaviorCategory> queryAllCategory(@Param("orgCode") String orgCode);

    BehaviorCategory queryCategoryById(int id);

    /**
     * 根据ID查询对应的排序编号
     * @param categoryIds
     */
    @MapKey("id")
    Map<Integer,Map<String,Integer>> selectSortMapByIds(@Param("categoryIds") List<Integer> categoryIds);
}
